ECL Summary Reading

This notebook is intended to be used for reading and plotting data from ECLIPSE summary files, i.e. UNSMRY and SMSPEC files, thus it can also be used to read the files written by the Flow reservoir simulator.

Requirements

This notebook uses the ecl_sum module from the ecl library in the ERT package.

File Paths & Imports


In [119]:
from ert.ecl import ecl_sum
import numpy as np
from matplotlib import pyplot as plt

#summary_path = '/home/einar/fieldopt_output/5SPOT'
#summary_path = '/home/einar/Documents/testpit/simulation/flow/spe9/SPE9'
#summary_path = '/home/einar/Documents/testpit/simulation/flow/spe1/SPE1CASE1'
#summary_path = '/home/einar/Documents/GitHub/PCG/FieldOpt/examples/ECLIPSE/HORZWELL/HORZWELL'
summary_path = '/home/einar/Documents/GitHub/PCG/FieldOpt/examples/Flow/5spot/5SPOT'
#summary_path = '/home/einar/Documents/GitHub/PCG/FieldOpt/examples/Flow/norne/NORNE_ATW2013'

Read the summary file and print keys


In [120]:
sum = ecl_sum.EclSum(summary_path)
print 'Case: ', sum.case
print 'Wells: ', sum.wells()
#print 'Groups: ', sum.groups()
#print 'Keys: ', sum.keys()
#print 'Time: ', sum.get_days()


Case:  /home/einar/Documents/GitHub/PCG/FieldOpt/examples/Flow/5spot/5SPOT
Wells:  ['INJ1','PROD1','PROD2','PROD3','PROD4']

Read and plot summary data


In [137]:
sum = ecl_sum.EclSum(summary_path)
data = {}
for key in sum.keys():
    data[key] = sum.get_values(key)
    
%matplotlib inline
for key in data.keys():
    if key.split(':')[0] == 'WOPT':
        plt.plot(sum.get_days(), data[key])



In [ ]: